//
//  PingAction.h
//  iOSLaboratory
//
//  Created by yangshansi on 2017/4/20.
//  Copyright © 2017年 WiLL. All rights reserved.
//

#import <Foundation/Foundation.h>

#import "PingTask.h"



@interface OnePingAction : NSObject

@property (nonatomic, readonly,  copy)   NSString *hostName;
@property (nonatomic, readwrite, copy)   NSString *ip;

@property (nonatomic, readwrite, assign) NSTimeInterval sendTime;
@property (nonatomic, readwrite, assign) NSTimeInterval recvTime;
@property (nonatomic, readwrite, assign) NSTimeInterval interval;


@property (nonatomic, readonly,  assign) NSInteger sequenceNumber;
@property (nonatomic, readonly,  assign) NSInteger timeout;
@property (nonatomic, readonly,  strong) NSData    *data;
@property (nonatomic, readwrite, assign) NSInteger packetSize;




/******************************************************************************/
/**** Static Method                                                        ****/
/******************************************************************************/
#pragma mark - Static Method

+ (instancetype)onePingActionWithMethod:(PingMethod)pingMethod
                         sequenceNumber:(NSInteger)sequenceNumber
                                   host:(NSString *)hostName
                                timeout:(NSInteger)timeout
                                   data:(NSData *)data;



/******************************************************************************/
/**** Customized Method                                                    ****/
/******************************************************************************/
#pragma mark - Customized Method

- (BOOL)doOnePing;



/******************************************************************************/
/**** Lifecycle Method                                                     ****/
/******************************************************************************/
#pragma mark - Lifecycle Method

- (instancetype)initWithHost:(NSString *)hostName
              sequenceNumber:(NSInteger)sequenceNumber
                     timeout:(NSInteger)timeout
                        data:(NSData *)data;


@end
